package icu.xblogs.report.plugin;

/**
 * @author Frank KONG
 * @version 1.0
 * @date 2020/11/18 14:26
 */
public class Page {

    private int total;//总的行数
    private int size;//每页的大小
    private int index;//页码  从1开始

    public Page(int size, int index) {
        this.size = size;
        this.index = index;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getOffset(){
        return size*(index-1);//offset 0 limit 50<size>
    }

    @Override
    public String toString() {
        return "Page{" +
                "total=" + total +
                ", size=" + size +
                ", index=" + index +
                '}';
    }

}
